Starts/Ends With Caseless
This crate provides the StartsWithCaseless
trait and the EndsWithCaseless
trait to extend types which implement AsRef<str>
in order to do starts_with
and ends_with
case-insensitively.
Examples
extern crate starts_ends_with_caseless;
use StartsWithCaseless;
assert_eq!;
assert_eq!;
extern crate starts_ends_with_caseless;
use EndsWithCaseless;
assert_eq!;
assert_eq!;
Multiple Prefixes or Suffixes
This crate also provides the StartsWithCaselessMultiple
trait and the EndsWithCaselessMultiple
trait to do starts_with_caseless
and ends_with_caseless
with multiple prefixes or suffixes.
Example
extern crate starts_ends_with_caseless;
use StartsWithCaselessMultiple;
assert_eq!;
No Std
This crate can work without std, but the starts_with_caseless
method and the ends_with_caseless
method will be disabled at this stage as well as the StartsWithCaselessMultiple
trait and the EndsWithCaselessMultiple
trait.
Enable the feature no_std to compile this crate without std.
[]
= "*"
= ["no_std"]
Crates.io
https://crates.io/crates/starts-ends-with-caseless
Documentation
https://docs.rs/starts-ends-with-caseless